package com.bfxy.disruptor.common.waitStraty;

import com.bfxy.disruptor.common.balance.Sequence;
import com.bfxy.disruptor.common.balance.SequenceBarrier;
import com.bfxy.disruptor.common.exception.AlertException;
import com.bfxy.disruptor.common.exception.TimeoutException;

public interface WaitStrategy
{
    /**
     * 等待
     */
    long waitFor(long sequence, Sequence cursor, Sequence dependentSequence, SequenceBarrier barrier)
        throws AlertException, InterruptedException, TimeoutException;

    /**
     唤醒
     */
    void signalAllWhenBlocking();
}
